package com.example.system.controller.user;

import com.example.common.core.controller.BaseController;
import com.example.common.core.domain.R;
import com.example.common.core.domain.TableDataInfo;
import com.example.system.domain.user.dto.UserDTO;
import com.example.system.domain.user.dto.UserQueryDTO;
import com.example.system.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController extends BaseController {
    @Autowired
    private UserService userService;

    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQueryDTO) {
        return getDataTable(userService.list(userQueryDTO));
    }

    @PutMapping("/updateStatus")
    public R<Void> updateStatus(@RequestBody UserDTO userDTO) {
        return toR(userService.updateStatus(userDTO));
    }

//    @DeleteMapping("/exitLogin")
//    public R<Void> exitLogin() {
//        return toR(userService.exitLogin());
//    }
}
